{% csrf_token %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的网库-文件上传成功</title>
<link href="../static/css/upload_successful.css" rel="stylesheet" type="text/css" />

{#<script src="../static/js/upload_successful.js"></script>#}
</head>


<!-- 网页的头部 导航栏 -->
<body>
<div class="div_head">
  <ul>
      <li><a href="{{ url }}/personalCenter">个人中心</a></li>
      <li><a href="{{ url }}/video_Upload">视频</a></li>
      <li><a href="{{ url }}/music_upload">音频</a></li>
      <li><a href="{{ url }}/img_upload">图片</a></li>
      <li><a href="{{ url }}/text_upload">文本</a></li>
      <li><a href="{{ url }}/index">首页</a></li>
    </ul>
</div>



<!-- 网页的主体部分 -->
<div class="div_body">

   <script type="text/javascript">
    // 设计一个函数 获取上一页面的url
    function get_before_url() {
        // document.referrer 获取上一页的url
         var before_url = document.referrer;
         console.log("获取的url是："+before_url);
        return before_url
    }

    var url = get_before_url();

    </script>

    <p id="p_success">XX上传成功</p>
    <!---window.history.back();返回上一页        javascript:change_herf(); --->
    <button type="button" id="already_button" onclick="change_herf(this)"><a href="#" id="already_a">查看已上传的文件</a></button>
    <button type="button"><a href="javascript:window.history.back();" id="before_button">继续上传相同类型的文件</a></button>


</div>

<script>
    //获取到 a标签对象
    var a_herf = document.getElementById("already_a");


    if(url === "{{ url }}/text_upload/"){
        // 改变p标签的内容
        document.getElementById("p_success").innerHTML="文本上传成功!";
        // 修改a标签的链接
        a_herf.href = "{{ url }}/text_successful/";

    }
    else if (url === "{{ url }}/img_upload/"){
        document.getElementById("p_success").innerHTML = "图片上传成功";
        a_herf.href = "{{ url }}/imgs_successful/";
    }
    else if(url === "{{ url }}/music_upload/"){
        document.getElementById("p_success").innerHTML = "音频上传成功";
        a_herf.href = "{{ url }}/music_successful/";
    }
    else if(url === "{{ url }}/video_Upload/"){
        document.getElementById("p_success").innerHTML = "视频上传成功";
       a_herf.href = "{{ url }}/video_successful/";
    }


</script>



<!-- 网页的底部 -->
<div class="div_foot" align="right">
<ul>
  	<li>
        <p><a href="{{ url }}/about_me">关于我们</a></p>
    </li>
    <li>
   	    <p><a href="about_me.html">联系我们</a></p>
    </li>
 	<li>
   	    <p><a href="about_me.html">公益活动</a></p>
 	</li>

</ul>

	<p align="center"> 省 ICP 备 XXXXXXXX 号  -X</p>

</div>

</body>
</html>
